package cn.tnar.controller;

import cn.tnar.constant.ResultCode;
import cn.tnar.response.Result;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: 陈亮
 * @Date: 2018/10/11 18:57
 */
@Api(tags = "Home")
@RestController
@RequestMapping("home")
public class HomeController {

    private Result result = new Result();

    @GetMapping("index")
    public Result index() {
        List<String> temp = new ArrayList<>();
        temp.add("张三");
        temp.add("李四");
        temp.add("王五");
//        result.setData(temp);
//        result.setResultCode(ResultCode.SUCCESS);
        result.setData(temp);
        result.setResultCode(ResultCode.DATABASE_OPERATE_ERROR);
        return result;
    }

}
